/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Berekenen;

/**
 *
 * @author Memet
 */
public class DetCheckResult {
    boolean succes;
    String[][] mat;
    static String[][] matrix= new String[][]{{"<font color=\"green\">1</font>/<font color=\"green\">E1</font>","<font color=\"green\">-v12</font>/<font color=\"green\">E1</font>","<font color=\"#C59E02\">-v31</font>/<font color=\"green\">E1</font>", "<font color=\"green\">0</font>", "<font color=\"green\">0</font>", "<font color=\"green\">0</font>"},
                                             {"<font color=\"green\">-v12</font>/<font color=\"green\">E1</font>","<font color=\"green\">1</font>/<font color=\"green\">E2</font>","<font color=\"green\">-v23</font>/<font color=\"green\">E2</font>", "<font color=\"green\">0</font>", "<font color=\"green\">0</font>", "<font color=\"green\">0</font>"},
                                             {"<font color=\"#C59E02\">-v31</font>/<font color=\"green\">E1</font>","<font color=\"#C59E02\">-v31</font>/<font color=\"green\">E2</font>","<font color=\"green\">1</font>/<font color=\"#C59E02\">E3</font>", "<font color=\"green\">0</font>", "<font color=\"green\">0</font>", "<font color=\"green\">0</font>"},
                                             {"<font color=\"green\">0</font>", "<font color=\"green\">0</font>", "<font color=\"green\">0</font>", "<font color=\"green\">1</font>/<font color=\"green\">G12</font>", "<font color=\"green\">0</font>", "<font color=\"green\">0</font>"},
                                             {"<font color=\"green\">0</font>", "<font color=\"green\">0</font>", "<font color=\"green\"></font>", "<font color=\"green\">0</font>", "<font color=\"green\">1</font>/<font color=\"green\">G23</font>", "<font color=\"green\">0</font>"},
                                             {"<font color=\"green\">0</font>", "<font color=\"green\">0</font>", "<font color=\"green\">0</font>", "<font color=\"green\">0</font>", "<font color=\"green\">0</font>", "<font color=\"green\">1</font>/<font color=\"#C59E02\">G31</font>"}};

    

    public DetCheckResult() {
        this.succes = true;

    }

    public DetCheckResult(int i1, int i2, int j1, int j2) {
        this.succes = false;
        mat = new String[(i2-i1)+1][(j2-j1)+1];
        int row = 0;
        for(int r = i1; r<=i2; r++)
        {
            int kol = 0;
            for(int k = j1; k<=j2; k++)
            {
                mat[row][kol] = matrix[r][k];
                kol++;
            }
            row++;
        }
        
    }



    public boolean isSucces() {
        return succes;
    }

    public void setSucces(boolean succes) {
        this.succes = succes;
    }

    @Override
    public String toString()
    {
        String msg = "";
        if(succes)
        {
            msg+="<font color=\"green\"><b>√</b></font> - Positive definition check succesfull";
        }else{
            msg+="<font color=\"#C59E02\"><b>!</b></font> - Positive defenition check was not succesfull<br />";
            msg+="<table border=1 bgcolor=\"#D9D9D9\">";
            for(int r = 0; r<mat.length; r++)
            {
                msg+="<tr>";
                for(int k = 0; k<mat[r].length; k++)
                {
                    msg+= "<td><b>"+mat[r][k]+ "</b></td>";
                }
                msg+="</tr>";
            }
            msg+="</table>";
        }

        msg+="";
        return msg;
    }
}
